﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AutoServey
{
    class StreetViewManager
    {
        public Hashtable pointHashTable = new Hashtable();

        public Queue<string> pointQueue = new Queue<string>();

        public bool isContained(streetViewPoint point)
        {
            return pointHashTable.ContainsKey(point.streetViewID);
        }

        public bool addStreetViewPoint(streetViewPoint point)
        {
            if (isContained(point)) return false;

            this.pointHashTable[point.streetViewID] = point;

            return true;
        }

        public void insertPointID(string streetViewID)
        {
            //去重
            if (pointQueue.Contains(streetViewID) == false && pointHashTable.Contains(streetViewID) == false)
            {
                this.pointQueue.Enqueue(streetViewID);
            }
        }

        public string getNextPointID()
        {
            if (pointQueue.Count <= 0) return string.Empty;

            else return pointQueue.Dequeue();
        }
    }
}
